package com.sky.controller.user;


import com.sky.entity.Setmeal;
import com.sky.result.Result;
import com.sky.service.ISetmealService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;


import java.util.List;

/**
 * <p>
 * 套餐 前端控制器
 * </p>
 *
 * @author fcy
 * @since 2025-09-11
 */
@RestController("userSetmealController")
@RequestMapping("/user/setmeal")
@Api(tags = "C端套餐接口")
public class SetmealController {
    @Autowired
    private ISetmealService setmealService;
    @ApiOperation("根据分类查询套餐")
    @GetMapping("/list")
    @Cacheable(cacheNames="setmealCache",key = "#categoryId")
    public Result<List<Setmeal>> list(Integer categoryId) {
        return setmealService.getUserList(categoryId);
    }
}
